package com.txunda.zhuohired.http;

import com.ants.theantsgo.base.BaseView;
import com.ants.theantsgo.config.Config;
import com.ants.theantsgo.httpTools.ApiTool2;
import com.lidroid.xutils.http.RequestParams;

/**
 * 创建人： Txd_Cjh
 * 创建时间： 2018/3/28 17:09
 * 功能描述：牛人完善信息
 * 联系方式：jiahuanchen@126.com
 */

public class Member {
    private static String url = Config.BASE_URL + "Member/";

    /**
     * 获取省级城市
     *
     * @param baseView
     */
    public void perfect(BaseView baseView) {
        RequestParams params = new RequestParams();
        ApiTool2 apiTool = new ApiTool2();
        apiTool.postApi(url + "perfect", params, baseView);
    }

    /**
     * 获取省级城市
     *
     * @param baseView
     */
    public void region(BaseView baseView) {
        RequestParams params = new RequestParams();
        ApiTool2 apiTool = new ApiTool2();
        apiTool.postApi(url + "region", params, baseView);
    }

    /**
     * 获取下一级
     *
     * @param id       上级id
     * @param baseView
     */
    public void getChild(String id, BaseView baseView) {
        RequestParams params = new RequestParams();
        ApiTool2 apiTool = new ApiTool2();
        params.addBodyParameter("id", id);
        apiTool.postApi(url + "getChild", params, baseView);
    }

    /**
     * 完善简历下一步
     *
     * @param name              姓名
     * @param sex               性别 1男 2女
     * @param birth             出生年月
     * @param workt             参加工作时间，无工作经验传0
     * @param domicile_province 参加工作省
     * @param domicile_city     参加工作市
     * @param domicile_area     参加工作区
     * @param phone             电话
     * @param email             邮箱
     * @param token             登陆之后传递的id
     * @param baseView
     */
    public void perfectIn(String name, String sex, String birth, String workt, String domicile_province, String
            domicile_city, String domicile_area, String phone, String email, String token, BaseView baseView) {
        RequestParams params = new RequestParams();
        ApiTool2 apiTool = new ApiTool2();
        params.addBodyParameter("name", name);
        params.addBodyParameter("sex", sex);
        params.addBodyParameter("birth", birth);
        params.addBodyParameter("workt", workt);
        params.addBodyParameter("domicile_province", domicile_province);
        params.addBodyParameter("domicile_city", domicile_city);
        params.addBodyParameter("domicile_area", domicile_area);
        params.addBodyParameter("phone", phone);
        params.addBodyParameter("email", email);
        params.addBodyParameter("token", token);
        apiTool.postApi(url + "perfectIn", params, baseView);
    }

    /**
     * 获取求职状态
     *
     * @param baseView
     */
    public void service(BaseView baseView) {
        RequestParams params = new RequestParams();
        ApiTool2 apiTool = new ApiTool2();
        apiTool.postApi(url + "service", params, baseView);
    }

    /**
     * 获取行业
     *
     * @param baseView
     */
    public void trade(BaseView baseView) {
        RequestParams params = new RequestParams();
        ApiTool2 apiTool = new ApiTool2();
        apiTool.postApi(url + "trade", params, baseView);
    }

    /**
     * 获取职位
     *
     * @param baseView
     */
    public void position(BaseView baseView) {
        RequestParams params = new RequestParams();
        ApiTool2 apiTool = new ApiTool2();
        apiTool.postApi(url + "position", params, baseView);
    }

    /**
     * 获取期望薪金
     *
     * @param baseView
     */
    public void salary(BaseView baseView) {
        RequestParams params = new RequestParams();
        ApiTool2 apiTool = new ApiTool2();
        apiTool.postApi(url + "salary", params, baseView);
    }

    /**
     * 完善简历第二页提交
     *
     * @param workplace_province 期望工作地-省
     * @param workplace_city     期望工作地-市
     * @param workplace_area     期望工作地-区
     * @param trade              行业id
     * @param position           职位id
     * @param salary             期望薪金id
     * @param service_id         求职状态id
     * @param token                 登录传递过来的id
     * @param baseView
     */
    public void perfectTwoIn(String workplace_province, String workplace_city, String workplace_area, String trade,
                             String position, String salary, String service_id, String token, BaseView baseView) {
        RequestParams params = new RequestParams();
        ApiTool2 apiTool = new ApiTool2();
        params.addBodyParameter("workplace_province", workplace_province);
        params.addBodyParameter("workplace_city", workplace_city);
        params.addBodyParameter("workplace_area", workplace_area);
        params.addBodyParameter("trade", trade);
        params.addBodyParameter("position", position);
        params.addBodyParameter("salary", salary);
        params.addBodyParameter("service_id", service_id);
        params.addBodyParameter("token", token);
        apiTool.postApi(url + "perfectTwoIn", params, baseView);
    }

}
